package zestaw4.zadanie1;

/**
 * Author: Daniel
 * Date: 03.08.13
 */

public class Teacher {
    private Person person;
    private int salary;

    public Teacher(Person person, int salary) {
        this.person = person;
        this.salary = salary;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof Teacher)) return false;
        Teacher teacher = (Teacher) obj;
        return salary == teacher.salary &&
                person.getName().equals(teacher.person.getName());
    }
}
